import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/pid";
// 查询合同信息列表
export function listContract(query) {
  return request({
    url: '/system/contract/list',
    method: 'get',
    params: query
  })
}

// 查询单个合同
export function singlecontract(contractId) {
  return request({
    url: '/system/contract/selectcontractbyid/'+ praseStrEmpty(contractId),
    method: 'get',
  })
}

// 查询合同信息详细
export function getContract(id,userId) {
  return request({
    url: '/system/contract/' + praseStrEmpty(id)+'/'+ praseStrEmpty(userId),
    method: 'get'
  })
}

// 新增合同信息
export function addContract(data) {
  return request({
    url: '/system/contract',
    method: 'post',
    data: data
  })
}

// 修改合同信息
export function updateContract(data) {
  return request({
    url: '/system/contract',
    method: 'put',
    data: data
  })
}


// 删除合同信息
export function delContract(id,attachmentId) {
  return request({
    url: '/system/contract/' + id + '/' + attachmentId,
    method: 'delete',
  })
}

// 导出合同信息
export function exportContract(query) {
  return request({
    url: '/system/contract/export',
    method: 'get',
    params: query
  })
}

